import { http } from '@/utils/http'
import type { Category, SubCategoryFilter } from './types.d'

/** 获取二级分类 */
export const categoryAPI = (id: string): Promise<Category> => {
  return http.get<Category>('/category', { id })
}

/**
 * 获取二级类目筛选列表
 * @param id 二级分类id
 *  */
export const subCategoryFilterAPI = (
  id: string
): Promise<SubCategoryFilter> => {
  return http.get<SubCategoryFilter>('/category/sub/filter', { id })
}
